<template>
    <div>
        <el-header style="text-align: right; font-size: 15px">
            <span>
                学生成绩
            </span>
        </el-header>
        <el-table
                :data="tableData"
                border
                style="width: 100%">
            <el-table-column
                    fixed
                    prop="s_id"
                    label="学号"
                    width="130%">
            </el-table-column>
            <el-table-column
                    fixed
                    prop="s_name"
                    label="姓名"
                    width="130%">
            </el-table-column>
            <el-table-column
                    fixed
                    prop="m_name"
                    label="专业"
                    width="150%">
            </el-table-column>
            <el-table-column
                    fixed
                    prop="s_class"
                    label="班级"
                    width="150%">
             </el-table-column>
            <el-table-column
                    fixed
                    label="成绩单"
                    width="100">
                <template slot-scope="scope">
                    <el-button @click="modify(scope.row)" type="text" size="small">点击查看</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default {
        methods: {
            modify(row){
                this.$router.push({
                    path: '/Page6',
                    query:{
                        id:row.s_id
                    }
                })
            }

        },
        created() {
            const _this = this
            axios.get('http://localhost:8181/major/findAll').then(function (resp) {
                _this.tableData = resp.data
            })
        },
        data() {
            return {
                total: null,
                tableData: null
            }
        }
    }
</script>